package com.sky.config;

import com.sky.properties.AliOssProperties;
import com.sky.utils.AliOssUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * ClassName: AliyunConfiguration
 * Package: com.sky.config
 * Description:阿里云工具类的配置类
 *
 * @Author: Zhang Peiyuan
 * @Create: 2024-12-18-15:45
 * @Version: v1.0
 */
@Configuration
@Slf4j
public class AliyunConfiguration {
    // 引入属性类
    @Resource
    public AliOssProperties aliOssProperties;

    @Bean
    public AliOssUtil aliOssUtil(){
        return new AliOssUtil(aliOssProperties.getEndpoint(),
                aliOssProperties.getAccessKeyId(),
                aliOssProperties.getAccessKeySecret(),
                aliOssProperties.getBucketName());
    }
}
